Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazily load the attachment_upload_to configuration setting #331

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

djw27
Copy link

@djw27 djw27 commented Oct 9, 2018

In our project structure we can't simply import a function into our settings file to use within the SUMMERNOTE_CONFIG - trying to import a function before the project has been initialised simply doesn't work. In our specific case we import settings from environment variables and use a multiple settings files per environment which complicates things further.

This PR changes the attachment_upload_to to accept the dot notation to the file to be used, which is then loaded when it's needed.

This is a breaking change so I could work some backwards compatibility in to this if it's something you'd like to use in master?

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 96.656% when pulling 0323284 on workshoptech:master into f5f34de on summernote:master.

@coveralls
Copy link

coveralls commented Oct 9, 2018

Coverage Status

Coverage decreased (-1.9%) to 96.644% when pulling 6f34790 on workshoptech:master into 5bcd829 on summernote:master.

@lqez lqez self-assigned this Oct 30, 2018
Bring up to date with master
@lqez
Copy link
Owner

lqez commented Dec 31, 2018

Thank you for contribution, @djw27.

We can make it without breaking backward compatibilties by detecting the type of attachment_upload_to. Could you make it uses get_by_qname only when a string has given to the config?

And it would be much appreciated if you can also provide a test for it.
Thanks.

Base automatically changed from master to main January 12, 2021 10:33
@lqez lqez force-pushed the main branch 2 times, most recently from 1a3c1dc to a194f5c Compare January 12, 2021 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants